<template>
    <div id="app">
      <el-form ref="add-equipment" :model="equipment" label-width="100px">
        <el-form-item label="设备名称">
          <el-input v-model="equipment.name" placeholder="请输入名称"></el-input>
        </el-form-item>
        <el-form-item label="设备价格">
          <el-input v-model="equipment.price" placeholder="请输入价格"></el-input>
        </el-form-item>
        <el-form-item label="描述">
          <el-input v-model="equipment.description"  type="textarea" rows="5"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="save()">提交</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
      data(){
        return {
          equipment:{}
        }
      },
      methods:{
        save(){
          //发出ajax请求
          this.axios.post("/equipment/add",this.equipment).then((resp)=>{
            this.$router.push("/equipment/EquipmentList");
          })
        }
      }
    }
</script>


<style scoped>

</style>
